from django.conf.urls.defaults import patterns

from django.contrib import admin
admin.autodiscover()

consts = { 
    'CATEGORY' : 'c',
    'DISH' : 'd',
    'PLACE' : 'p',
    'PROFILE' : 'u',
    'EDIT_REVIEW' : 'edit_review',
    'ADD_REVIEW' : 'add_review',
    'DELETE_PIC' : 'delete/photo',
    'RATE' : 'rate'
}

urlpatterns = patterns('apps.food.views',
                       (r'^$', 'home'),
                       (r'^' + consts['CATEGORY'] + '/([\w\-]+)$', 'category'),
                       (r'^' + consts['DISH'] + '/([\w\-]+)$', 'dish'),
                       (r'^' + consts['PLACE'] + '/([\w\-]+)$', 'place'),
                       (r'^' + consts['PROFILE'] + '/([\w\-\_\@\.\+]+)$', 'profile'),
                       #(r'^([\w\-]+)/([\w\-]+)$', 'display_review'),
                       (r'^' + consts['EDIT_REVIEW'] + '/(\d+)$', 'edit_review'),
                       (r'^' + consts['ADD_REVIEW'] + '/(\d+)$', 'add_review'),
                       (r'^add/dish$', 'add_dish'),
                       (r'^' + consts['DELETE_PIC'] + '/(\d+)$', 'delete_photo'),
                       (r'^' + consts['RATE'] + '/(?P<id>\d+)/(?P<rating>good|bad)$', 'rate'))